package org.accp.baodan.dto;

import entity.warranty_info;

import java.util.List;

public class PageBean{

        private Integer pageIndex=1;//页码
        private Integer pageSize=3;//数据条数
        private Integer pageCount;//总页数
        private Integer rowCount;//总行数
        private List data;//
        private warranty_info warrantyInfo;//保单实体类

    public warranty_info getWarrantyInfo() {
        return warrantyInfo;
    }

    public void setWarrantyInfo(warranty_info warrantyInfo) {
        this.warrantyInfo = warrantyInfo;
    }

    public PageBean(Integer pageIndex, Integer pageSize, Integer rowCount){
            this.rowCount=rowCount;
            //锟斤拷锟斤拷锟揭筹拷锟�
            if(rowCount%pageSize==0){// 13  3
                this.pageCount=rowCount/pageSize;
            }
            else{
                this.pageCount=rowCount/pageSize+1;
            }
            System.err.println("fcc"+pageIndex);
            this.pageIndex=pageIndex;//4   1
            if(pageIndex>this.pageCount) this.pageIndex=this.pageCount;
            if(pageIndex<=1) this.pageIndex=1;
        }


        public PageBean() {
            super();
            // TODO Auto-generated constructor stub
        }





        //锟斤拷始锟铰憋拷    between  ? and ?
        public Integer getStartIndex(){
            return (this.pageIndex-1)*this.pageSize+1;
        }
        //锟斤拷锟斤拷锟铰憋拷
        public Integer getEndIndex(){
            return this.pageIndex*pageSize;
        }

        public Integer getPageIndex() {
            return pageIndex;
        }
        public void setPageIndex(Integer pageIndex) {
            this.pageIndex = pageIndex;
        }
        public Integer getPageSize() {
            return pageSize;
        }
        public void setPageSize(Integer pageSize) {
            this.pageSize = pageSize;
        }
        public Integer getPageCount() {
            return pageCount;
        }
        public void setPageCount(Integer pageCount) {
            this.pageCount = pageCount;
        }
        public Integer getRowCount() {
            return rowCount;
        }
        public void setRowCount(Integer rowCount) {
            this.rowCount = rowCount;
        }
        public List getData() {
            return data;
        }
        public void setData(List data) {
            this.data = data;
        }

    }


